package com.lanou3g.demo.mapper;

import com.lanou3g.demo.entity.AdminInfo;
import com.lanou3g.demo.entity.AdminRole;
import com.lanou3g.demo.entity.impl.AdminInfoImpl;
import com.lanou3g.demo.entity.ModuleInfo;
import java.sql.SQLException;
import java.util.List;


public interface AdminInfoMapper {
    AdminInfo findOne1(AdminInfo name);
    AdminInfo findOne(AdminInfo name);

    List<ModuleInfo> findModule(String name);

    // 查看个人信息
    AdminInfo selectAdminInfoWithRoleName(AdminInfo adminInfo);

    // 修改个人信息 姓名,电话,Email
    int updateAdminInfo(AdminInfo adminInfo);

    // 修改密码
    int updateAdminPwd(AdminInfo adminInfo);

    // 查看所有的管理员
    List<AdminInfoImpl> selectAllAdmin();

    // 查询管理员
    List<AdminInfoImpl> selectRoleWithAdmin(String roleName);

    // 增加管理员:在admin_info中插入返回主键
    int insertAdminInfo(AdminInfo adminInfo) throws SQLException;

    // 增加管理员:在admin_role中插入
    int insertAdminRole(List<AdminRole> adminRoles) throws SQLException;

    // 修改管理员信息回显
    AdminInfoImpl modifyFindAdmin(AdminInfoImpl adminInfo);

    // 修改管理员相关角色回显
    List<AdminRole> modifyFindRole(AdminInfo adminInfo);

    // 更新adminInfo
    int updataAdminId(AdminInfo adminInfo) throws SQLException;

    // 删除原角色信息
    int deleteAdminWithRole(String adminId) throws SQLException;

    // 删除管理员
    int deleteAdmin(String adminId) throws SQLException;

    // 重置密码
    int resetPwd(List<String> adminIds) throws SQLException;


}